﻿using System;
using System.Data;
using System.Data.Common;
using Liger.Common;
using Liger.Data;

namespace EasyFMS.Model
{

	/// <summary>
	/// 实体类zCompany
	/// </summary>
	[Serializable]
	public class zCompany : Entity 
	{ 
		 public zCompany() 
            : base("zCompany") 
        { 

        }


		#region Model
		private int _compcode;
		private string _compname;
		private string _comptitle;
		private int? _supcompcode;
		private string _compmark;
		private string _compstatus;
	 
		/// <summary>
		/// 
		/// </summary>
		public int compcode
		{
			get{ return _compcode; }
			set
			{
				this.OnPropertyValueChange(_.compcode,_compcode,value);
				this._compcode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string compname
		{
			get{ return _compname; }
			set
			{
				this.OnPropertyValueChange(_.compname,_compname,value);
				this._compname = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string comptitle
		{
			get{ return _comptitle; }
			set
			{
				this.OnPropertyValueChange(_.comptitle,_comptitle,value);
				this._comptitle = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? supcompcode
		{
			get{ return _supcompcode; }
			set
			{
				this.OnPropertyValueChange(_.supcompcode,_supcompcode,value);
				this._supcompcode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string compmark
		{
			get{ return _compmark; }
			set
			{
				this.OnPropertyValueChange(_.compmark,_compmark,value);
				this._compmark = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string compstatus
		{
			get{ return _compstatus; }
			set
			{
				this.OnPropertyValueChange(_.compstatus,_compstatus,value);
				this._compstatus = value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.compcode,
				_.compname,
				_.comptitle,
				_.supcompcode,
				_.compmark,
				_.compstatus
			};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				_compcode,
				_compname,
				_comptitle,
				_supcompcode,
				_compmark,
				_compstatus
			};
		} 
		/// <summary>
		/// 设置字段值
		/// </summary>
		public override void SetValue(string fieldName, object value)
        {
            switch (fieldName)
            { 
				case "compcode":
                    this._compcode = DataHelper.ConvertValue<int>(value);
                    break; 
				case "compname":
                    this._compname = DataHelper.ConvertValue<string>(value);
                    break; 
				case "comptitle":
                    this._comptitle = DataHelper.ConvertValue<string>(value);
                    break; 
				case "supcompcode":
                    this._supcompcode = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "compmark":
                    this._compmark = DataHelper.ConvertValue<string>(value);
                    break; 
				case "compstatus":
                    this._compstatus = DataHelper.ConvertValue<string>(value);
                    break; 
            }
        }
		/// <summary>
		/// 获取字段值
		/// </summary>
        public override object GetValue(string fieldName)
        {
            switch (fieldName)
            { 
				case "compcode":
                    return this._compcode; 
				case "compname":
                    return this._compname; 
				case "comptitle":
                    return this._comptitle; 
				case "supcompcode":
                    return this._supcompcode; 
				case "compmark":
                    return this._compmark; 
				case "compstatus":
                    return this._compstatus; 
				default :
                    return null;
            } 
        }



		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","zCompany");
 
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field compcode = new Field("compcode","zCompany","compcode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field compname = new Field("compname","zCompany","compname");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field comptitle = new Field("comptitle","zCompany","comptitle");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field supcompcode = new Field("supcompcode","zCompany","supcompcode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field compmark = new Field("compmark","zCompany","compmark");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field compstatus = new Field("compstatus","zCompany","compstatus");
		}
		#endregion

 
	}
}

